//源码****
import React, { useCallback } from 'react';
import chainmakerLogo from '../assets/svgs/chainmakerLogo.svg';
import chainmakerLOGOLogin from '../assets/svgs/chainmakerLOGOLogin.svg';
import '../login.css';
import { versionConfig } from '@/config';
export default function LoginPage() {
  const toRedirect = useCallback(() => {
    window.location.href = `${versionConfig.serverHost}login/redirect?auth_server=CHAINMAKER&site=${encodeURIComponent(window.location.origin)}`;
  }, []);
  return <div className='login_page'>
    <div className="login_header">
      <img src={chainmakerLogo}/>ChainMaker SmartEditor
    </div>
    <div className='login_content'>
      <div className='login_form'>
        <div className='login_title'>ChainMaker SmartEditor</div>
        <img src={chainmakerLOGOLogin}/>
        <div className='login_info'>你可以使用长安链官网账号或者gitlab账号登录ChainMaker SmartEditor，如您未注册请先注册</div>
        <div className='login_action'>
          <div className='regist' onClick={toRedirect}>注册</div>
          <div className='space'></div>
          <div className='login' onClick={toRedirect}>登录</div>
        </div>
      </div>
    </div>
  </div>;
}
